﻿#define _CRT_SECURE_NO_WARNINGS 1
#include "AVLTree.h"
#include <vector>
int main()
{
	vector<int> v1 = { 16, 3, 7, 11, 9, 26, 18, 14, 15 };
	vector<int> v2 = { 4, 2, 6, 1, 3, 5, 15, 7, 16, 14 };

	AVLTree<int, int> a;
	for (auto e : v2)
	{
		a.Insert(make_pair(e, 0));
	}
	a.Inorder();
	a.InorderBf();

	cout << a.Height() << endl;
	
	if (a.IsBalance())
		cout << "平衡" << endl;
	else
		cout << "不平衡" << endl;
	
	cout << a.Size() << endl;
	
	AVLTreeNode<int, int>* p = a.Find(16);
	if (p == nullptr)
		cout << "不存在" << endl;
	else
		cout << "存在此节点" << endl;
	return 0; 
}
